#include <stdio.h>
#include <stdlib.h>
#include "create_rand.h"
#include "sort_sm.h"

#define MAX_SIZE  101

int main()
{
	int list[MAX_SIZE];
	int i, n;

	printf("Please enter the numbers of the datas: ");
	scanf("%d",&n);

	if (n < 1 || n > MAX_SIZE){
		fprintf(stderr,"The size must be betweem 1 to %d\n",MAX_SIZE);
		exit(1);
	}
	create_rand(list,n);
	for(i = 0;i < n;i++){
		printf("list[%d] = %d\n",i,list[i]);
	}
	printf("Sorting...\n");

	sort_sm(list,n);

	printf("And then the data is:\n");

	for(i = 0;i < n;i++){
		printf("list[%d] = %d\n",i,list[i]);
	}

	printf("The sorting is %s\n",(is_rising(list,n)?"OK":"Failed"));

	return 0;
}

